![]() |
MPSetTimerNotify |
||||
Header: | Multiprocessing.h | Carbon status: | Supported | |
Sets the notification information associated with a timer.
OSStatus MPSetTimerNotify ( MPTimerID timerID, MPOpaqueID notificationID, void *notifyParam1, void *notifyParam2, void *notifyParam3 );
The ID of the timer whose notification information you want to set.
The ID of the notification mechanism to associate with the timer. This value should be the ID of an event group, a message queue, or a semaphore.
If anID specifies an event group, this parameter should contain the flags to set in the event group when the timer expires. If anID specifies a message queue, this parameter should contain the first 32-bits of the message to be sent to the message queue when the timer expires.
If anID specifies a message queue, this parameter should contain the second 32-bits of the message to be sent to the message queue when the timer expires. Pass NULL if you don’t need this parameter.
If anID specifies a message queue, this parameter should contain the third 32-bits of the message sent to the message queue when the timer expires. Pass NULL if you don’t need this parameter.
A result code.
When the timer expires, Multiprocessing Services checks the notification ID, and if it is valid, notifies the related notification mechanisms (that is, event groups, queues, or semaphores) you had specified in your MPSetTimerNotify calls.
You can specify multiple notification mechanisms by calling this function several times. For example, you can call MPSetTimerNotify to specify a message queue and then call it again to specify a semaphore. When the timer expires, a message is sent to the message queue and the appropriate semaphore is signaled. You cannot, however, specify more than one notification per notification mechanism (for example, if you call MPSetTimerNotify twice, specifying different messages or message queues in each call, the second call will overwrite the first). Note that if a call to MPSetTimerNotify returns an error, any previous calls specifying the same timer are still valid; previously set notifications will still be notified when the timer expires.
You can set the notification information at any time. If the timer is armed, it will modify the notification parameters dynamically. If the timer is disarmed, it will modify the notification parameters to be used for the next MPArmTimer call.
Introduced with Multiprocessing Services 2.0.
Supported in Carbon. Available in CarbonLib 1.0 and later when MPLibrary 2.0 or later is installed. Exported by CarbonLib 1.0 and later and by MPLibrary 2.0 and later.
© 2000 Apple Computer, Inc. — (Last Updated 4/6/2000)